<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <ul>
            <li v-for="value in arr">{{value}}</li>
        </ul>
        <input type="button" value="添加数组元素" @click="addValue()">
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                arr:[1,2,3,4,5,6,7]
            },
            methods:{
                addValue(){
                    // this.arr.push(Math.random());
                    this.arr.unshift(Math.random());
                }
            }
        })
    </script>
</body>
</html>